using System;
using System.Collections.Generic;
using System.Text;

namespace Ent.Web.WebControl
{
    internal enum TextAlign { Right, Left, Center, None }
    internal enum InputType { Text, TextArea, Submit, Button, Checkbox, Radio, Hidden, Password, File, Image, Reset, None}
    internal class FormElement
    {
        public string Label;
        public InputType Type = InputType.Text;
        public string Name;
        public string Value;
        public bool Checked = false;
        public int MaxLength;
        public string Alt;
        public bool Disabled = false;
        public bool ReadOnly = false;
        public string Size;
        public string Src;
        public TextAlign Align = TextAlign.Left;
        public static InputType GetType(string type)
        {
            switch (type.ToLower())
            {
                case "text":
                    return InputType.Text;
                case "textarea":
                    return InputType.TextArea;
                case "submit":
                    return InputType.Submit;
                case "button":
                    return InputType.Button;
                case "checkbox":
                    return InputType.Checkbox;
                case "radio":
                    return InputType.Radio;
                case "hidden":
                    return InputType.Hidden;
                case "password":
                    return InputType.Password;
                case "file":
                    return InputType.File;
                case "image":
                    return InputType.Image;
                case "reset":
                    return InputType.Reset;
                default: return InputType.None;
            }
        }
        public static TextAlign GetAllign(string align)
        {
            switch (align.ToLower())
            {
                case "right":
                    return TextAlign.Right;
                case "left":
                    return TextAlign.Left;
                case "center":
                    return TextAlign.Center;
                default: return TextAlign.None;
            }
        }
    }
}
